#include "timer.h"

using namespace alice;

Timer* Timer::instance_ = nullptr;

void Timer::Tick() {
  delta_time_ = (SDL_GetTicks() - last_time_) * (kTargetFps / 1000.0f);
  if (delta_time_ > kTargetDeltaTime) {
    delta_time_ = kTargetDeltaTime;
  }
  last_time_ = SDL_GetTicks();
}